package com.sanyu.controller.admin;

import com.sanyu.pojo.dto.ArticleDTO;
import com.sanyu.pojo.dto.ArticlePageQueryDTO;
import com.sanyu.pojo.dto.DistrictDTO;
import com.sanyu.pojo.dto.MessagePageQueryDTO;
import com.sanyu.pojo.vo.MessageVO;
import com.sanyu.result.PageResult;
import com.sanyu.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/article")
@Api("后台管理页面/首页文章相关接口")
public class ArticleController {
    @GetMapping("/{id}")
    @ApiOperation("根据文章ID获取文章详细信息")
    public Result getMessageById(@PathVariable Long id){
        MessageVO messageVO = new MessageVO();
        return Result.success(messageVO);
    }

    @GetMapping("/page")
    @ApiOperation("分页查询文章列表")
    public Result<PageResult> page(ArticlePageQueryDTO articlePageQueryDTO){
        PageResult pageResult = new PageResult();
        return Result.success(pageResult);
    }

    @PostMapping("/add")
    @ApiOperation("新增文章")
    public Result add(@RequestBody ArticleDTO articleDTO){
        return Result.success();
    }

    @DeleteMapping("/{id}")
    @ApiOperation("删除指定ID的文章")
    public Result delete(@PathVariable Long id){
        return Result.success();
    }

    @PutMapping
    @ApiOperation("修改指定ID的文章")
    public Result update(@RequestBody ArticleDTO articleDTO){
        return Result.success();
    }
}
